package com.xhwl.logistics.controller;

import com.xhwl.common.pojo.ResultJson;
import com.xhwl.logistics.bo.VehicleParkingSpaceBO;
import com.xhwl.logistics.converter.mapstruct.VehicleCarportConverter;
import com.xhwl.logistics.service.IVehicleParkingSpaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


//@RestController
public class VehicleParkingSpaceController {

    @Autowired
    private IVehicleParkingSpaceService iVehicleParkingSpaceService;
    @Autowired
    private VehicleCarportConverter vehicleCarportConverter;

    @GetMapping("/get-spaces")
    public ResultJson getCountForSpace(@RequestParam Integer projectId){
        VehicleParkingSpaceBO vehicleParkingSpaceBO = iVehicleParkingSpaceService.getCountForSpace(projectId);
        return ResultJson.successWithResult(vehicleCarportConverter.toVehicleCarSpaceCoSonVO(vehicleParkingSpaceBO));
    }

}
